package com.lipi.mall.order.feign;

import com.lipi.common.utils.R;
import com.lipi.mall.order.vo.WareSkuLockVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("ware")
public interface WareFeignService {

    /**
     * 传入skuIdList，查询各项sku对应的可用库存信息
     *
     * @param skuIds
     * @return
     */
    @RequestMapping("/ware/waresku/skuHasStock")
    R skuHasStock(@RequestBody List<Long> skuIds);


    /**
     * 查询地址对应的邮费
     *
     * @param addrId
     * @return
     */
    @RequestMapping("/ware/wareinfo/fare")
    R getFare(@RequestParam("addrId") Long addrId);


    /**
     * 创建订单时锁定库存
     *
     * @param vo
     * @return
     */
    @PostMapping("/ware/waresku/lock/order")
    R orderLockStock(@RequestBody WareSkuLockVO vo);
}
